<template>
  <div>
    <!-- <h1 class="text-center">用户登陆数据</h1> -->
    <section class="content">
        <!--<div class="box">-->
            <!--<div class="box-header with-border">
                <h3 class="box-title">demo</h3>
            </div>-->
            <div class="box-body">
                <button class='btn btn-primary btn-lg' @click='total'>所有APP</button>
                <button class='btn btn-danger btn-lg' @click='ebuapp'>衣布到位APP</button>
                <button class='btn btn-warning btn-lg' @click='yklapp'>衣快链APP</button>
                <button class='btn btn-warning btn-lg' @click='genPie'>登陆频率分布图</button>
                <div id="loginBar" style="width: 850px; height: 500px; margin-top: 25px; clear: both;" v-show='!showPie'></div>
                <div id="disPie" style="width: 850px; height: 500px; margin-top: 25px; clear: both;" v-show='showPie'></div>
                <!--<div id="function" style="width: 850px; height: 500px; float: left; clear: both;"></div>-->
            </div>
        <!--</div>-->
    </section>
  </div>
</template>
<script>
  import {getData} from '../../../static/js/echart/login'
  import {genPie} from '../../../static/js/echart/appdis'
  // const echartsjsurl = '/static/js/echart/echarts.simple.min.js'
  const echartsjsurl = '/static/js/echart/echarts.min.js'
  // const pluginURL = '/static/js/echart/login.js'

  export default {
    name: 'app_login',
    data: function () {
      return {
        showPie: false
      }
    },
    mounted () {
      this.$nextTick(() => {
        window.jQuery.getScript(echartsjsurl, () => {
          this.showPie = false
          getData('')
        })
      })
    },
    methods: {
      ebuapp: function () {
        this.showPie = false
        var obj = {}
        obj.appName = 3
        getData(JSON.stringify(obj))
      },
      yklapp: function () {
        this.showPie = false
        var obj = {}
        obj.appName = 1
        getData(JSON.stringify(obj))
      },
      total: function () {
        this.showPie = false
        getData('')
      },
      genPie: function () {
        this.showPie = true
        genPie()
      }
    }
  }
</script>

<style>
</style>
